	<div class="modal-panel modal-panel-sm">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
					角色菜单设置
				</h4>
			</div>
			<div class="modal-body">
				<form class="settingform">
				<input type="hidden" name="role_id">
				<div class="treepanel">
					<ul id="RMtree" class="ztree"></ul>
				</div>
				</form>
			</div>
			<div class="modal-footer">
				<button type="reset" class="btn btn-default">重置</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary">提交</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
<script>
$(document).ready(function(){
	
	$("#roleM button.btn-primary").on('click',function(){
		 _p = $(this).getParentTab();
		 m = getMenuByPermit('admin:role:menu');
		 
		 if(m){
            nodes=$.fn.zTree.getZTreeObj("RMtree").getCheckedNodes(true);
			for(x=0;x<nodes.length;x++){
				$("#roleM .settingform").append("<input name=\"menu_id\" value=\""+nodes[x].tid+"\" type='hidden'>");
            }
		 
			getData(m.url,$("#roleM .settingform").serialize(),
			function(res){
				messageBox(res.msg,'角色菜单设置结果');
				if(res.code==200){
					$("#roleM").modal('hide');
				}
			});
		}
			
	});
});
</script>